import React from 'react'
import { connect } from 'react-redux'

const mapStateToProps = state => ({ ...state })

const ConnectedList = ({ articles }) => {
  return (
    <ul>
      {articles.map(el => (
        <li key={el.id}>
          {el.title}
        </li>
      ))}
    </ul>
  )
}

const List = connect(mapStateToProps)(ConnectedList)

export default List